import store from "../../store";

export default {
  inserted(el, binding, vnode) {
    let btnPermission = store.state.vuex_menu.buttonList;
    console.log(22,store.state.vuex_menu.buttonList);
    if (btnPermission && btnPermission.length) {
      if (!btnPermission.filter(v => {
        return v.buttonId === binding.value;
      }).length) {
        if (el.parentNode) {
          el.parentNode.removeChild(el);
        } else el.remove();
      }
    } else {
      if (el.parentNode) {
        el.parentNode.removeChild(el);
      } else el.remove();
    }
  },
}
